<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button onclick="sub()">提交</button>
    <script>
        function sub() {
            $.ajax({
            url:"login",
            type:"POST",
            data:{"username":"aaa","password":123},
            success:function(ret) {
                if(ret == 1) {
                    alert("登陆成功");
                }
            }
        })
        }
        
    </script>
</body>
</html>